/*
Miranda IM History Sweeper plugin
Copyright (C) 2002-2003  Sergey V. Gershovich
Copyright (C) 2006-2007  borkra

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
#ifndef __HISTORYSWEEPER_H__
#define __HISTORYSWEEPER_H__

// this plugin is for Miranda 0.6 only
#define MIRANDA_VER 0x0600

#include <windows.h>
#include <commctrl.h>

#include "newpluginapi.h"
#include "m_clc.h"
#include "m_clist.h"
#include "m_clui.h"
#include "m_database.h"
#include "m_langpack.h"
#include "m_options.h"
#include "m_system.h"
#include "win2k.h"
#include "m_icolib.h"

#include "resource.h"

// Plugin name
#define ModuleName "History Sweeper"
#define ModuleVersion PLUGIN_MAKE_VERSION(0,1,3,1)


// Plugin UUID for New plugin loader
// req. 0.7.18+ core
// {4AA5EACC-CE9D-11DB-B131-5E9956D89593}
#define MIID_HISTORYSWEEPER {0x4aa5eacc, 0xce9d, 0x11db, { 0xb1, 0x31, 0x5e, 0x99, 0x56, 0xd8, 0x95, 0x93 }}

// Services
#define MS_HS_SWEEPCONTACTHISTORY      "HistorySweeper/SweepContactHistory"
#define MS_HS_SWEEPHISTORYFROMMAINMENU "HistorySweeper/SweepHistoryFromMainMenu"

// main.c
extern HINSTANCE hInst;
void ModifyMainMenu(void);

// options.c
const char* menu_items[3];
int HSOptInitialise(WPARAM wParam,LPARAM lParam);
typedef struct {
/*
	BYTE StartupSweep;
	BYTE ShutdownSweep;
	BYTE MainMenuIcon;
	BYTE ContactMenuIcon;
	BYTE MainMenuAction;
	BYTE StartupShutdownAction;
	BYTE MainMenuOlder;
	BYTE StartupShutdownOlder;
	BYTE UnsafeMode;
*/
	BYTE EventsIncomingMessages;
	BYTE EventsOutgouingMessages;
	BYTE EventsURL;
	BYTE EventsStatusMessage;
	BYTE EventsFiles;
	BYTE EventsContacts;
	BYTE EventsStatus;
	BYTE EventsNick;
	BYTE EventsAvatar;
	BYTE EventsWATrack;
	BYTE EventsVoiceCall;
	BYTE EventsICQRemove;
	BYTE EventsICQIgnoreCheck;
	BYTE EventsICQClientChange;
	BYTE EventsICQAuth;
	BYTE EventsICQCheckStatus;
	BYTE EventUnknown;
} HSEVENTS ;

HSEVENTS hs_events;

// historysweeper.c
void SSAction(void);
int MainMenuAction(WPARAM wParam,LPARAM lParam);
int ContactMenuAction(WPARAM wParam,LPARAM lParam);

// iconlib.c
void IconsInit( void );
HANDLE __stdcall GetIconHandle( int iconId );

// menus.c
static HMENU hMainMenuHandle = NULL;
static HMENU hContactMenuHandle = NULL;
void MenuInit (void);
int RebuildContactMenu(WPARAM wParam,LPARAM lParam);

// m_updater.h
// wParam = (int)fileID				- this is the file ID from the file listing (i.e. the number at the end of the download link)
// lParam = (PLUGININFO*)&pluginInfo
#define MS_UPDATE_REGISTERFL	"Update/RegisterFL"


// events
#define EVENTTYPE_MESSAGE				0
#define EVENTTYPE_URL					1
#define EVENTTYPE_CONTACTS				2
#define EVENTTYPE_ADDED					1000  //v0.1.1.0+: these used to be module-
#define EVENTTYPE_AUTHREQUEST			1001  //specific codes, hence the module-
#define EVENTTYPE_FILE					1002  //specific limit has been raised to 2000
#define EVENTTYPE_STATUSCHANGE			25368  // from srmm's
#define EVENTTYPE_NICKNAMECHANGE		9001   // from pescuma
#define EVENTTYPE_STATUSMESSAGECHANGE	9002   // from pescuma
#define EVENTTYPE_AVATARCHANGE			9003   // from pescuma
#define EVENTTYPE_VOICE_CALL			8739   // from pescuma
#define EVENTTYPE_CONTACTLEFTCHANNEL	9004   // from pescuma
#define EVENTTYPE_SMTPSIMPLE			2350   // from SMTP Simple
#define EVENTTYPE_WAT_ANSWER			9602 

#define ICQEVENTTYPE_SMS				2001 
#define ICQEVENTTYPE_EMAILEXPRESS		2002 
#define ICQEVENTTYPE_WEBPAGER			2003 
#define ICQEVENTTYPE_AUTH_GRANTED		2004 
#define ICQEVENTTYPE_AUTH_DENIED		2005 
#define ICQEVENTTYPE_SELF_REMOVE		2007 
#define ICQEVENTTYPE_FUTURE_AUTH		2008 
#define ICQEVENTTYPE_CLIENT_CHANGE		2009 
#define ICQEVENTTYPE_CHECK_STATUS		2010 
#define ICQEVENTTYPE_IGNORECHECK_STATUS	2011 

#endif
